// 功能按钮类结构
import 'package:flutter/material.dart';
import 'package:hkzf_flutter/scoped_model/auth_model.dart';
import 'package:hkzf_flutter/utils/scoped_model_helper.dart';

class FunctionButtonItem {
  final String? imageUri; // 图片路径
  final String? title; // 标题
  final Function? onTaoHandle;
  FunctionButtonItem({this.imageUri,this.title,this.onTaoHandle}); 
}
// 默认点击处理事件
Function defaultTapHandle = (BuildContext context) {
  print('点击了功能按钮');
};

// 功能按钮数据列表
final List<FunctionButtonItem> functionButtonItemList = [
   FunctionButtonItem(
    imageUri: 'static/images/home_profile_record.png',
    title:'看房记录',
    onTaoHandle:null
   ),
   FunctionButtonItem(
    imageUri: 'static/images/home_profile_order.png',
    title:'我的订单',
    onTaoHandle:null
   ),
   FunctionButtonItem(
    imageUri: 'static/images/home_profile_favor.png',
    title:'我的收藏',
    onTaoHandle:null
   ),
   FunctionButtonItem(
    imageUri: 'static/images/home_profile_id.png',
    title:'身份认证',
    onTaoHandle:null
   ),
   FunctionButtonItem(
    imageUri: 'static/images/home_profile_message.png',
    title:'联系我们',
    onTaoHandle:null
   ),
   FunctionButtonItem(
    imageUri: 'static/images/home_profile_contract.png',
    title:'电子合同',
    onTaoHandle:null
   ),
   FunctionButtonItem(
    imageUri: 'static/images/home_profile_house.png',
    title:'房屋管理',
    onTaoHandle:(context){
      // TODO : 获取登录状态
      bool isLogin =  ScopedModelHelper.getModel<AuthModel>(context).isLogin;
      if(isLogin){
        Navigator.pushNamed(context, '/roomManage');
      }else{
        Navigator.pushNamed(context, '/login');
      }
    }
   ),
   FunctionButtonItem(
    imageUri: 'static/images/home_profile_wallet.png',
    title:'钱包',
    onTaoHandle:null
   ),
];
